package com.zhengbing.tj.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

@Configuration
/**
 * 线程池配置类
 * 提供应用所需的线程池实例
 *
 * @author zhengbing
 * @date 2025-07-31
 */
public class ThreadPoolConfig {

    @Bean(name = "fileExecutorService")
    /**
     * 创建文件操作专用线程池
     *
     * @return 固定大小的线程池实例，核心线程数为5
     * @see Executors#newFixedThreadPool(int)
     */
    public ExecutorService fileExecutorService() {
        return Executors.newFixedThreadPool(5);
    }
}